{% extends "index.html" %}

{% block mainmenu %}
<div class="button" onclick="javascript:document.location='/'">News</div>
<div class="button" onclick="javascript:document.location='/folders'">Folders</div>
<div class="button" onclick="javascript:document.location='/groups'">Groups</div>
<div class="button" onclick="javascript:document.location='/search'">Search</div>
<div class="button" onclick="javascript:document.location='/profile'">Profile</div>
<div class="button" onclick="javascript:document.location='/logout'">Logout</div>
{% endblock %}

{% block rightpart %}
<div class="folderheader">Folders</div>
{% if folders %}
<div class="rightmenu" onclick="javascript:document.location='/folders/';">All</div>
<div class="rightmenu" onclick="javascript:document.location='/favorites/';">Favorites</div>
{% for p in folders %}
<div id="openfolder{{p.id}}" class="rightmenu" onclick="javascript:document.location='/folder/{{p.id}}';">{{p.title}}</div>
{% endfor %}
{% endif %}
<div id="createfolder" class="rightmenu" onclick="javascript:create_new_folder();">Create new folder</div>
{% endblock %}

{% block leftpart %}

<div class="folderbody" id="folderbody{{folder.id}}">

<div class="folderheader" id="folderheader{{folder.id}}">
<div class="folderheadertext"><a href="/folder/{{folder.id}}">{{folder.title}}</a> - {{folder.folderentry_set.count}} entries</div>
{% if userfolder %}
<div class="smallbutton" onclick="javascript:addfeed({{folder.id}});">add feed</div>
<div class="smallbutton" onclick="javascript:document.location='/folder/{{folder.id}}/edit';">edit</div>
{% endif %}
<div class="smallbutton" id="togglefolder{{folder.id}}" onclick="javascript:togglefolder({{folder.id}});">hide</div>
<div class="smallbutton" onclick="javascript:updatefolder({{folder.id}});">update</div>
{% if userfolder %}
<div class="smallbutton" onclick="javascript:cleanfolder({{folder.id}});">clean</div>
<div class="smallbutton" onclick="javascript:purgefolder({{folder.id}});">purge</div>
{% endif %}
</div>

{% for e in entries %}
{% with e.entry as entry %}
<div class="entry" id="entry{{folder.id}}_{{entry.id}}">
<div style="display:table-cell;width:100%;padding-bottom:3px;">
<h3><a href="javascript:favorite({{entry.id}});"><img src="/img/star.png" style="padding-right:5px;"/></a>{% if userfolder %}<a href="javascript:delete_entry({{folder.id}},{{entry.id}});"><img src="/img/delete.png" style="padding-right:5px;"/></a>{% endif %}<a href="/entry/{{ entry.id }}">{{ entry.title }}</a>
<a href="javascript:tweetentry('{{entry.url}}','{{entry.title}}',{{entry.id}})" name="tweet{{entry.id}}" ><img src="/img/twitter.ico" alt="Tweet this!" title="Tweet this!"></img></a>
<a href="javascript:facebook_share('{{entry.url|escapejs}}','{{entry.title|escapejs}}')"><img src="/img/facebook.ico" alt="Share on Facebook" title="Share on Facebook"></img></a>
<a href="javascript:bookmark_on_delicious('{{entry.url}}','{{entry.title}}');"><img src="http://static.delicious.com/img/delicious.small.gif" height="10" width="10" alt="Bookmark this on Delicious" title="Bookmark this on Delicious"></img></a>
</h3></div>
<div class="timestamp" style="display:table-cell;white-space: nowrap;">{{entry.created}}</div>
<div class="undercomment"><a href="{{entry.url}}">{{entry.url}}</a></div>
{% autoescape off %}
{{entry.summary}}
{% endautoescape %}
</div>
{% endwith %}
{% endfor %}
{% if more %}
<div class="entry" name="more{{folder.id}}" style="text-align:center" >
<a href="javascript:more_folder({{folder.id}},{{more}});">MORE</a>
</div>
{% endif %}
</div>

{% endblock %}
